import request from './requestAll.js'
//引入request.js 文件 https://www.god.521xun.top
const baseURL='http://127.0.0.1:8888'
const headerjson= {'Content-Type':'application/json' }
const headerxfu= {'content-type': 'application/x-www-form-urlencoded'}
let Header= {'content-type': 'application/x-www-form-urlencoded','Authorization':'Bearer '+wx.getStorageSync('token')}
class Api {
    // 用户信息请求
    getUserinfo(data){
        Header= {'content-type': 'application/x-www-form-urlencoded','Authorization':'Bearer '+wx.getStorageSync('token')}
        return request.post(baseURL+'/my/userinfo',data,Header)
    }
    // 发送邮箱
    postReguserCode(data){
        return request.post(baseURL+'/my/reguserCode',data,Header)
    }
    // 获取城市
    getcite(data){
        return request.post(baseURL+'/rest/weather',data,Header)
    }
     // 获取城市
     postcitePlus(data){
        return request.post(baseURL+'/rest/weatherPlus',data,Header)
    }
    // 获取天气
    postWeatherInfo(data){
        return request.post(baseURL+'/rest/getWeatherInfo',data,Header)
    }
    // 增加热度
    postheatInfo(data){
        return request.post(baseURL+'/rest/heatInfo',data,Header)
    }
    // 获取格言
    getMottoInfo(data){
        return request.get(baseURL+'/rest/getMottoInfo',data,Header)
    }
    // 申请推送
    postsubmitCite(data){
        return request.post(baseURL+'/rest/submitCite',data,Header)
    }
    // 用户登录
    postUserLogin(data){
        console.log(data)
        return request.post(baseURL+'/api/login',data,headerxfu)
    }
    // 修改用户信息
    updateUserInfo(data){
        return request.post(baseURL+'/my/userinfo/update',data,Header)
    }
    // 添加计划
    postAddPlain(data){
        return request.post(baseURL+'/plan/addplan',data,Header)
    }
    // 修改删除计划
    postUpdatePlan(data){
        return request.post(baseURL+'/plan/updatePlan',data,Header)
    }
    // 加经验
    getGrowth(data){
        return request.post(baseURL+'/rest/getGrowth',data,Header)
    }
    // 查询计划
    postSelectPlan(data){  
        Header= {'content-type': 'application/x-www-form-urlencoded','Authorization':'Bearer '+wx.getStorageSync('token')} 
        return request.post(baseURL+'/plan/selectDayPlan',data,Header)
    }
    // 查询计划详情
    postSelectPlanDetail(data){   
        return request.post(baseURL+'/plan/selectPlanDetail',data,Header)
    }
    // 查询壁纸头像框
    postToExamine(data){
        return request.post(baseURL+'/plan/verify/ValidationII',data,Header)
    }
    // 发送推送消息
    postToExamineEnd(data){
        return request.post(baseURL+'/plan/verify/ValidationI',data,Header)
    }

}
const api = new Api()
export default api

